package com.Digui;

public class Digui {
    public static void main(String[] args) {
        System.out.println(add(5));
        System.out.println(cheng(3));
    }

    public static Integer add(Integer i) {
        if (i == 1) {
            return 1;
        }

        return i + add(i - 1);
    }

    public static Integer cheng(Integer j) {
        if (j == 1) {
            return 1;
        }
        return j * cheng(j - 1);
    }

}
